import { GetHomeList } from '@/api'
const state = {
  dataList:{}
}
const mutations = {
  GETBANNERLIST(state,data){
    state.dataList = data
  }
}
const actions = {
  async getBannerList({commit}){
    let result = await GetHomeList()
    console.log(result.data)
    commit('GETBANNERLIST',result.data)
  }
}
const getters = {
  bannerList(state){
    return state.dataList.banner
  },
  categoryList(state){
    return state.dataList.categoryList || [{goodsList:[]},{goodsList:[]},{goodsList:[]}]
  },
  brandList(state){
    return state.dataList.brandList || []
  },
  hotGoodsList(state){
    return state.dataList.hotGoodsList || []
  }
}
export default{
  namespaced:true,
  state,
  mutations,
  actions,
  getters
}